package com.oig.sys.file.api.factory;

import com.oig.sys.file.api.FileInfoService;
import com.oig.sys.file.api.fallback.FileInfoServiceFallBackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class FileInfoFallBackFactory implements FallbackFactory<FileInfoService> {

    @Override
    public FileInfoService create(Throwable cause) {
        FileInfoServiceFallBackImpl fileInfoServiceFallBack = new FileInfoServiceFallBackImpl();
        fileInfoServiceFallBack.setCause(cause);
        return fileInfoServiceFallBack;
    }
}
